Optimal. Leaf size=116 \[ \frac {1}{8} (3 a A+4 b B+4 a C) x+\frac {(A b+a B+b C) \sin (c+d x)}{d}+\frac {(3 a A+4 b B+4 a C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {(A b+a B) \sin ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {4159, 4132,
2715, 8, 4129, 3092} \begin {gather*} \frac {\sin (c+d x) (a B+A b+b C)}{d}+\frac {\sin (c+d x) \cos (c+d x) (3 a A+4 a C+4 b B)}{8 d}-\frac {(a B+A b) \sin ^3(c+d x)}{3 d}+\frac {1}{8} x (3 a A+4 a C+4 b B)+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 3092
Rule 4129
Rule 4132
Rule 4159
Rubi steps
\begin {align*} \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {a A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {1}{4} \int \cos ^3(c+d x) \left (-4 (A b+a B)-(3 a A+4 b B+4 a C) \sec (c+d x)-4 b C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {1}{4} \int \cos ^3(c+d x) \left (-4 (A b+a B)-4 b C \sec ^2(c+d x)\right ) \, dx-\frac {1}{4} (-3 a A-4 b B-4 a C) \int \cos ^2(c+d x) \, dx\\ &=\frac {(3 a A+4 b B+4 a C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {1}{4} \int \cos (c+d x) \left (-4 b C-4 (A b+a B) \cos ^2(c+d x)\right ) \, dx-\frac {1}{8} (-3 a A-4 b B-4 a C) \int 1 \, dx\\ &=\frac {1}{8} (3 a A+4 b B+4 a C) x+\frac {(3 a A+4 b B+4 a C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a A \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {\text {Subst}\left (\int \left (-4 (A b+a B)-4 b C+4 (A b+a B) x^2\right ) \, dx,x,-\sin (c+d x)\right )}{4 d}\\ &=\frac {1}{8} (3 a A+4 b B+4 a C) x+\frac {(A b+a B+b C) \sin (c+d x)}{d}+\frac {(3 a A+4 b B+4 a C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {(A b+a B) \sin ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 117, normalized size = 1.01 \begin {gather*} \frac {36 a A c+48 b B c+48 a c C+36 a A d x+48 b B d x+48 a C d x+24 (3 A b+3 a B+4 b C) \sin (c+d x)+24 (b B+a (A+C)) \sin (2 (c+d x))+8 A b \sin (3 (c+d x))+8 a B \sin (3 (c+d x))+3 a A \sin (4 (c+d x))}{96 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 141, normalized size = 1.22
method | result | size |
derivativedivides | \(\frac {a A \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {A b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+\frac {B a \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+b B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \sin \left (d x +c \right ) b}{d}\) | \(141\) |
default | \(\frac {a A \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {A b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+\frac {B a \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+b B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \sin \left (d x +c \right ) b}{d}\) | \(141\) |
risch | \(\frac {3 a A x}{8}+\frac {B b x}{2}+\frac {a x C}{2}+\frac {3 A b \sin \left (d x +c \right )}{4 d}+\frac {3 a B \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (d x +c \right ) C b}{d}+\frac {a A \sin \left (4 d x +4 c \right )}{32 d}+\frac {A b \sin \left (3 d x +3 c \right )}{12 d}+\frac {\sin \left (3 d x +3 c \right ) B a}{12 d}+\frac {a A \sin \left (2 d x +2 c \right )}{4 d}+\frac {\sin \left (2 d x +2 c \right ) b B}{4 d}+\frac {\sin \left (2 d x +2 c \right ) a C}{4 d}\) | \(151\) |
norman | \(\frac {\left (\frac {3}{8} a A +\frac {1}{2} b B +\frac {1}{2} a C \right ) x +\left (-\frac {3}{2} a A -2 b B -2 a C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {3}{8} a A -\frac {1}{2} b B -\frac {1}{2} a C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {3}{8} a A -\frac {1}{2} b B -\frac {1}{2} a C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{4} a A +b B +a C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{4} a A +b B +a C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{8} a A +\frac {1}{2} b B +\frac {1}{2} a C \right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\left (5 a A -8 A b -8 B a +4 b B +4 a C -8 C b \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (5 a A +8 A b +8 B a +4 b B +4 a C +8 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (21 a A -8 A b -8 B a -12 b B -12 a C -24 C b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}-\frac {\left (21 a A +8 A b +8 B a -12 b B -12 a C +24 C b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {\left (39 a A -8 A b -8 B a +12 b B +12 a C +24 C b \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}-\frac {\left (39 a A +8 A b +8 B a +12 b B +12 a C -24 C b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}\) | \(444\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 132, normalized size = 1.14 \begin {gather*} \frac {3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A b + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b + 96 \, C b \sin \left (d x + c\right )}{96 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.39, size = 97, normalized size = 0.84 \begin {gather*} \frac {3 \, {\left ({\left (3 \, A + 4 \, C\right )} a + 4 \, B b\right )} d x + {\left (6 \, A a \cos \left (d x + c\right )^{3} + 8 \, {\left (B a + A b\right )} \cos \left (d x + c\right )^{2} + 16 \, B a + 8 \, {\left (2 \, A + 3 \, C\right )} b + 3 \, {\left ({\left (3 \, A + 4 \, C\right )} a + 4 \, B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 392 vs.
\(2 (108) = 216\).
time = 0.46, size = 392, normalized size = 3.38 \begin {gather*} \frac {3 \, {\left (3 \, A a + 4 \, C a + 4 \, B b\right )} {\left (d x + c\right )} - \frac {2 \, {\left (15 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 72 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 72 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.90, size = 150, normalized size = 1.29 \begin {gather*} \frac {3\,A\,a\,x}{8}+\frac {B\,b\,x}{2}+\frac {C\,a\,x}{2}+\frac {3\,A\,b\,\sin \left (c+d\,x\right )}{4\,d}+\frac {3\,B\,a\,\sin \left (c+d\,x\right )}{4\,d}+\frac {C\,b\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,a\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {A\,b\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,a\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________